<template>
  <div>
    <div
      class="fly-panel"
      v-for="(item, index) in advertisement"
      :key="'advitem' + index"
    >
      <div class="fly-panel-title">{{ item.title }}</div>
      <div
        class="fly-panel-main"
        v-for="(item, index) in item.contents"
        :key="'contentitem' + index"
      >
        <a
          target="_blank"
          class="fly-zanzhu"
          time-limit="2017.09.25-2099.01.01"
          style="background-color: #5fb878"
          >{{ item.content }}</a
        >
      </div>
    </div>
  </div>
</template>

<script>
import { getadver } from '@/api/content'
export default {
  name: 'Ads',
  data () {
    return {
      advertisement: '',
    }
  },
  mounted () {
    this.adverAdd()
  },
  methods: {
    adverAdd () {
      getadver().then((res) => {
        if (res.code === 200) {
          // console.log(res.data);
          this.advertisement = res.data
        }
      }
      )
    }
  },
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss"></style>
